/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Simtest;

import simframe.simulation.*;

/**
 *
 * @author Steve Noble
 */
public class TestSim extends Simulation{

    public TestSim() {

        // define simulation

        Swarm<AgentY> swarmY = new Swarm<AgentY>();
        Swarm<AgentX> swarmX = new Swarm<AgentX>();

       for( int ii = 0; ii < 3; ++ii) {
            AgentY y = new AgentY();
            AgentX x = new AgentX(y);
            swarmY.add(y);
            swarmX.add(x);
        }

        Long t = new Long(0);

      swarmX.addInitSwarmAction(AgentX.initSwarm, t, new Time.Next() {

            public long getNext(long t) {
               return t + Time.Period.Weekly.getTics();
            }
        });

       this.newThread().addSimObject(swarmX).setDebug("XT");
       this.newThread().addSimObject(swarmY).setDebug("YT");

//        AgentY y = new AgentY();
//        AgentX x = new AgentX(y);
//
//        this.newThread().addSimObject(x);
//        this.newThread().addSimObject(y);
    }

      public static void main(String args[]) {

          // start up sim

          TestSim sim = new TestSim();

          sim.reset();

          sim.DaysPerSecond(1);

       
        Thread simThread = new Thread(sim);

        simThread.start();
    }

}
